		var selectedRoleInfos = null;
		var s_edit_h = 'hidden';
		var s_remove_h = 'hidden';
		var prefix = basepath + "/trade/query";
		
		$(function() {
			//searchRole()
			loadTradeDetailTable();
		});
		
		function getTradeStatus () {
			let tradeStatus = $("select#tradingStatus").val()
			console.log('getTradeStatus' + tradeStatus)
			return tradeStatus
		}
		
		function getTradeType () {
			let tradeType = $("select#tradeType").val()
			console.log('getTradeType' + tradeType)
			// alert('roleNameSel:' + roleNameSel)
			return tradeType
		}
		function getBankCardNbr () {
			let bankCardNbr = $("input#bankCardNbr").val()
			console.log('getBankCardNbr' + bankCardNbr)
			// alert('roleNameSel:' + roleNameSel)
			return bankCardNbr
		}
		function getProdName () {
			let prodName = $("input#prodName").val()
			console.log('getProdName' + prodName)
			// alert('roleNameSel:' + roleNameSel)
			return prodName
		}
		function getEnterpriseName () {
			let enterpriseName = $("input#enterpriseName").val()
			console.log('getEnterpriseName' + enterpriseName)
			// alert('roleNameSel:' + roleNameSel)
			return enterpriseName
		}
		function getTradeDateBegin () {
			let tradeDateBegin = $("input#tradeDateBegin").val()
			console.log('getTradeDateBegin' + tradeDateBegin)
			// alert('roleNameSel:' + roleNameSel)
			return tradeDateBegin
		}
		function getTradeDateEnd () {
			let tradeDateEnd = $("input#tradeDateEnd").val()
			console.log('getTradeDateEnd' + tradeDateEnd)
			// alert('roleNameSel:' + roleNameSel)
			return tradeDateEnd
		}
		
		function loadTradeDetailTable () {
			layui.use('table', function(){
				  var table = layui.table;
				  
				  //第一个实例
				  table.render({
				    elem: '#detailsTable'
				    ,height: 390
				    ,url: prefix + '/queryFinanceDetails' //数据接口
				    //,page: true //开启分页

				    ,page: true

				  	,where: { //设定异步数据接口的参数
				  		tradingStatus: getTradeStatus()
					    ,tradeType: getTradeType()
					    ,bankCardNbr: getBankCardNbr()
					    ,prodName: getProdName()
					    ,enterpriseName: getEnterpriseName()
					    ,tradeDateBegin: getTradeDateBegin()
					    ,tradeDateEnd: getTradeDateEnd()
					}
				    ,cols: [[ //表头
				      {field: 'orderNumber', title: '流水号',width:100, sort: true, fixed: 'left'}
				      ,{field: 'bankCardNbr', title: '账号',width:100}
				      ,{field: 'tradeDateFmt1', title: '日期',width:100}
				      ,{field: 'enterpriseName', title: '企业名称',width:100}
				      ,{field: 'prodName', title: '产品名称',width:100}
				      ,{field: 'income', title: '收入（元）',width:100}
				      ,{field: 'output', title: '支出（元）',width:100}
				      ,{field: 'tradingResult', title: '状态',width:100}
				      ,{field: 'tradeDesc', title: '交易类型',width:100}
				      ,{field: 'bankRetMsg', title: '错误信息',width:100}
				      ,{field: 'accountBalance', title: '当前余额',width:100}


				    ]]
				  });
				  
				  
				  
				});
			
				
			
		}
			
		function searchDetails() {
			// alert('ready to search')
			clearTradeDetailTable()
			loadTradeDetailTable()
		}
		
		function clearTradeDetailTable() {
			let tableSet = document.getElementById("detailsTableSet")
			
			var childs = tableSet.childNodes;
			
			console.log('tableSet.childNodes length:' + childs.length)
			

			childs.forEach(function(value,index,array){
				tableSet.removeChild(array[index])
    		});
			
			tableSet.removeChild(tableSet.firstChild)

			var para=document.createElement("table");
			para.setAttribute("id", "detailsTable")
			para.setAttribute("lay-filter", "detailInfo")
			tableSet.appendChild(para)

		}
		

		

